package com.just.recruitback.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.just.recruitback.entity.Company;
import com.just.recruitback.model.PageInfo;
import com.just.recruitback.service.CompanyService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author baibaiwuchang
 * @since 2020-07-02
 */
@RestController
@RequestMapping("/company")
public class CompanyController {
    @Resource
    private CompanyService companyService;

    @GetMapping("/list")
    public Page<Company> getCompany(String name, int count, int size) {
       return companyService.pageCompany(name, new PageInfo(count, size));
    }

    @GetMapping("/one")
    public Company getCompany(int companyId) {
        return companyService.getOne(companyId);
    }

}
